package com.yxx.business.enums;

import lombok.Getter;

import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

@Getter
public enum PhaseEnum {

    survey_design_phase("勘察设计阶段"),
    material_production_phase("建材生产运输阶段"),
    construction_phase("施工阶段"),
    operation_phase("运营维护阶段"),
    demolition_phase("拆除处置阶段");

    private final String phase;

    PhaseEnum(String phase) {
        this.phase = phase;
    }

    public final static Map<String, PhaseEnum> map = Arrays.stream(PhaseEnum.values()).collect(Collectors.toMap(PhaseEnum::getPhase, v -> v));

    public final static List<PhaseEnum> list = Arrays.asList(PhaseEnum.values());

    public static PhaseEnum getPhaseEnum(String phase) {
        return map.get(phase);
    }
}
